/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task08.task0818;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

/* 
只针对富人
*/

public class Solution {
    public static HashMap<String, Integer> createMap() {
        //在此编写你的代码
        HashMap<String, Integer> map = new HashMap<>();
        for (int i = 0; i < 1000; i += 100) {
            map.put("pan" + i, 100 + i);
        }
        return map;
    }

    public static void removeItemFromMap(HashMap<String, Integer> map) {
        //在此编写你的代码
        HashMap<String, Integer> copy = new HashMap<>(map);
        Iterator<Map.Entry<String, Integer>> iterator = map.entrySet().iterator();
        while (iterator.hasNext()) {
            Map.Entry<String, Integer> pair = iterator.next();
            String key = pair.getKey();
            Integer value = pair.getValue();
            if (value < 500) {
                iterator.remove();
            }
        }
    }

    public static void main(String[] args) {

    }
}